<!DOCTYPE html PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN" "http://www.w3.org/TR/html4/loose.dtd">
<html>
<head>
	<meta http-equiv="content-type" content="text/html; charset=UTF-8">
	<title>Galleria Picasa</title>
	<script type="text/javascript" src="/js/jquery-1.4.2.js"></script>
	<script type="text/javascript" src="/js/galleria.js"></script>
    <script type="text/javascript" src="/js/plugins/galleria.picasa.js"></script>
	<script type="text/javascript" src="/js/jquery.json-2.2.js"></script>
	<!--<script type="text/javascript" src="/js/plugins/galleria.history.js"></script>-->
	
	<!--<link rel="stylesheet" href="http://dev.jquery.com/view/trunk/plugins/autocomplete/demo/main.css" type="text/css" />-->
	<!--<link rel="stylesheet" href="http://dev.jquery.com/view/trunk/plugins/autocomplete/jquery.autocomplete.css" type="text/css" />-->
	<!--<script type="text/javascript" src="http://dev.jquery.com/view/trunk/plugins/autocomplete/lib/jquery.bgiframe.min.js"></script>-->
	<!--<script type="text/javascript" src="http://dev.jquery.com/view/trunk/plugins/autocomplete/lib/jquery.dimensions.js"></script>-->
	<!--<script type="text/javascript" src="http://dev.jquery.com/view/trunk/plugins/autocomplete/jquery.autocomplete.js"></script>-->
  
<script type="text/javascript">
	// Load theme
	Galleria.loadTheme('/js/themes/fullscreen/galleria.fullscreen.js');
	Galleria.loadTheme('/js/themes/lightbox/galleria.lightbox.js');
	Galleria.loadTheme('/js/themes/picasa/galleria.picasa.album.js');
	// intiialize picasa plugin
	var picasa = new Galleria.Picasa();
	
	function show() {
    	$('#loading').show();
    	show($('#username').val(), $('#albumid').val());
	}
	
   	function show(userId, albumId) {
		// inject a photset into galleria
	    picasa.getPhotos(userId, albumId, { 
	        //size: 1024
	        //max: 5
	    }, function(data) {
	    	$('#loading').hide();
	        $('#galleria').galleria('fullscreen', {
	        	autoplay: false,
	            data_source:data,
	            image_crop: false,
	            frame_color: '#000',
	            transition: 'slide',
	            hide_dock: false,
	            preload: 'all',
	            extend: function() {
	                this.$('info,counter').show();
	            },
	            thumb_quality: false,
	            popup_links: true
	        });
	    });
	}

	$(document).ready(function() {
		//show("Enoha.3e4eMois", "5396106273195797201");
		picasa.getAlbums(null, { 
	        //size: 1024
	        //max: 5
	    }, function(data) {
	    	$('#galleria').galleria('picasa.album', {
	            data_source:data
	    	});
		    /*
	    	$.each(data, function(idx, album) {
	    		var picture = new Picture();
	    		picture.load(album.image);
	    		picture.moveIn(picture.image);
		    	$('#galleria').append(picture.elem);
	    	});
	    	*/
	    });
	});
</script>
</head>

<body>
	<div id="galleria"></div>

</body>
</html>
